const bmap = require('./bmap-wx.min.js')

function decodeGPS() {
  return new Promise((reslove, reject) => {
    const BMap = new bmap.BMapWX({
      ak: 'qrH745lgcGUyfFKYxm83eTmZDQ6cnI3y'
    })
    BMap.regeocoding({
      fail: () => {
        reject('解析失败')
      },
      success: data => {
        reslove(data.originalData.result)
      }
    })
  })
}

module.exports = {
  decodeGPS
}
